package org.jeecg.entity.car;

import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.enums.car.CarDerateModeEnum;
import org.jeecg.enums.car.CarDerateTypeEnum;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.modules.system.entity.BaseEntity;

/**
 * @Description: 优惠卷明细
 * @Author: liurui
 * @Date:   2020-11-08
 * @Version: V1.0
 */
@Data
@TableName("car_derate_details")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="car_derate_details对象", description="优惠卷明细")
public class CarDerateDetails extends BaseEntity  {

	@Excel(name = "车场",width = 20)
	@TableField(exist = false)
	private String parkName;

	@TableField(exist = false)
	private String parkId;

	@Excel(name = "减免商家",width = 20)
	@TableField(exist = false)
	private String merchantName;

	@TableField(exist = false)
	private Integer derateType;

	@Excel(name = "优惠券类型",width = 20)
	@TableField(exist = false)
	private String derateTypeName;

	@TableField(exist = false)
	private String derateMode;

	@Excel(name = "优惠券规则",width = 20)
	@TableField(exist = false)
	private String derateModeName;

	/**优惠卷标识*/
    @ApiModelProperty(value = "优惠卷标识")
	private String derateId;
	/**id*/
	@TableId(type = IdType.ID_WORKER_STR)
    @ApiModelProperty(value = "id")
	private String id;
	/**车牌*/
	@Excel(name = "车牌", width = 15)
    @ApiModelProperty(value = "车牌")
	private String plateNumber;
	/**减免金额*/
	@Excel(name = "减免金额", width = 15)
	@ApiModelProperty(value = "减免金额")
	private BigDecimal derateAmount;
	/**projectId*/
    @ApiModelProperty(value = "项目id")
	private String projectId;

	/**状态：0 已绑定 1已使用*/
    @ApiModelProperty(value = "状态：0 已绑定 1已使用")
	private Integer status;

	@Excel(name = "使用状态", width = 15)
	@TableField(exist = false)
	private String statusName;

	/**tenantId*/
    @ApiModelProperty(value = "tenantId")
	private String tenantId;

	/**createBy*/
	@ApiModelProperty(value = "createBy")
	private String createBy;
	/**创建时间*/
	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "创建时间")
	private Date createTime;
	/**delFlag*/
	@ApiModelProperty(value = "delFlag")
	private String delFlag;
	/**updateBy*/
    @ApiModelProperty(value = "updateBy")
	private String updateBy;
	/**修改时间*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "修改时间")
	private Date updateTime;
	/**使用时间*/
	@Excel(name = "使用时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "使用时间")
	private Date useTime;

	/**备注*/
	@Excel(name = "备注", width = 30)
	@ApiModelProperty(value = "备注")
	private String remarks;

	public String getDerateTypeName() {
		return CarDerateTypeEnum.getDesc(this.derateType);
	}

	public String getDerateModeName() {
		return CarDerateModeEnum.getDesc(this.derateMode);
	}

	public String getStatusName() {
		if (this.getStatus() == null) return "";
		if (this.getStatus() == 0) return "已绑定、未出场";
		if (this.getStatus() == 1) return "已使用";
		return statusName;
	}

}
